package j.util.jdbc.simple.core.support;

/**
 * 数据库中一些运算符，主要由以下几部分组成：
 * <ol>
 * 	<li>逻辑运算符，如= 不等于  大于 小于 逻辑与等</li>
 * 	<li>升序降序符，如ASC DESC</li>
 * </ol>
 * @author 刘军海
 * @version 2011-8-26 上午9:13:15
 *
 */
public enum DbOperator {

	/**
	 * equals
	 * =
	 */
	EQ{
		@Override
		public String toString() {
			return "=";
		}
	},
	/**
	 * not equals 
	 * <>
	 */
	NotEQ{
		@Override
		public String toString() {
			return "<>";
		}
	},
	/**
	 * Less Than
	 * <=
	 */
	LT{
		@Override
		public String toString() {
			return "<";
		}
	},
	/**
	 * Less than or equal to
	 * <=
	 */
	LTOrEq{
		@Override
		public String toString() {
			return "<=";
		}
	},
	/**
	 * Greater Than
	 * >
	 */
	GT{
		@Override
		public String toString() {
			return ">";
		}
	},
	/**
	 * Greater Than or equal to
	 * >=
	 */
	GTOrEq{
		@Override
		public String toString() {
			return ">=";
		}
	},
	/**
	 * like
	 */
	LIKE{
		@Override
		public String toString() {
			return "LIKE";
		}
	},
	/**
	 * 升序
	 * ASC
	 */
	ASC{
		@Override
		public String toString() {
			return "ASC";
		}
	},
	/**
	 * 降序
	 * DESC
	 */
	DESC{
		@Override
		public String toString() {
			return "DESC";
		}
	},
	/**
	 * 逻辑与
	 * AND
	 */
	LogicalAND{
		@Override
		public String toString() {
			return " AND ";
		}
	},
	/**
	 * 逻辑或
	 * AND
	 */
	LogicalOR{
		@Override
		public String toString() {
			return " OR ";
		}
	};
	
	/**
	 * 将项转换为数据库所认可的操作符
	 */
	public abstract String toString();
}
